package com.example.myapplication.ad

import android.content.Context
import android.util.Log
import com.bytedance.sdk.openadsdk.TTAdConfig
import com.bytedance.sdk.openadsdk.TTAdManager
import com.bytedance.sdk.openadsdk.TTAdSdk
import com.bytedance.sdk.openadsdk.TTCustomController
import com.bytedance.sdk.openadsdk.mediation.init.MediationConfig
import com.bytedance.sdk.openadsdk.mediation.init.MediationConfigUserInfoForSegment
import com.bytedance.sdk.openadsdk.mediation.init.MediationPrivacyConfig
import com.example.myapplication.BuildConfig
import com.example.myapplication.R
import com.example.myapplication.appViewModel
import com.example.myapplication.utils.SPUtils
import org.json.JSONException
import org.json.JSONObject


/**
 * 可以用一个单例来保存TTAdManager实例，在需要初始化sdk的时候调用
 */
object TTAdManagerHolder {
    private const val TAG = "TTAdManagerHolder"
    private const val localSettings =
        "{\"cypher\":2,\"message\":\"2IMiiexAc8FrOa2iZIYuLPIyFYFfzJ80zAUt1duES3iVwGySiYVtCT5bi4HYM6poU9b4UMZ9lkFNL7I6Du6UfFqx2Y2IALmgNSK+A5FbdeBEzbB0nrYPK6aSPruwkSj9oooFBobfOR+nLG+U4uNhUR2GtuwlkmA0mIMu5TgOV3sKnqixEAF9AaXxWpDjiAMV+rkBWtI+3BBfVc1PmZmCLNtKkGEvxFJli9nroTecQoAGIErFZbRgOQfldmARdxy7zuopCBPaAo8uXdHyF8j4qsN6d1R0/rnp/1OTF0777Dd8XiHrWyriYOxjZxFSOy0En8+6p9ftPsoK7qCzJOjB9ZTejafOpEORTBP83gP9cU3sp4ktGzo0qMalxZVabOtcu1owEiu7IdMrTW58eMJM11cgMly7lAgsp56Cmtmr7D42N2duGXzk/03bi9fOAGUCpOJCLNqhNeoQQvEyfURVOjyUOQJpz5/ncwW65eAnNmmHrbPn2uh4A+9doLnFV64BkuUJ3j0C7Neu5kzGT+Hou3QPG+4s5YkiZOwumICRAhzFGT3sRPRoJWfbSG6mEzccMDEmNJ1Wmgc+fK9bszDiySG/P3G8WqdlzmA7ragcxsS/n2kS3iIi/NFth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OekNMw4UGxHJq75E443s2lF4+jNL1TD0HAXNoxr6l6qc1bMM0FidtQ1+u/Wy8fgXiG2drQnMQ4cNwaf23HlRtKFvDKMuTJloWg9scxlnAtmLoOED5WyQdTqiFQfNNvRnAndE9cSAcWCN9o6IxfYw83jcsbI+6eVnOjGcQjBfzD7drh31GgN3G/0sjiskP4q3ABkxucG/chD6sdG8rNsFA4FMOjuu5/87y1ZGDh8a3V6uOaplx33GJK6LNef+3W9tewimBd7XOdgK42uhD0S/6Dt4IXT4N9Evo5+LtRcupPPOUBQy785hYQCZOQm5Ijcyfrm+jZ28Go9rbPYTqVWXQqvr2y6DADKq76QscjhG1AbBCGYEPYjzb9JQmkhCAUF2Lk4MwInNMI6Z0WMXS6Fz/jz6Gx4Ijaq1+Xf2PG5IFtidxo9WTqTh7wt1am2UvQyUlDsE1d7kSWcfzPiGF3D+WoxwmON6mFhrrcCTuDYwsCgX5TTJ+NKcyQj01bHt+pcU+QbR9uEFmlP+inC8rTEfzHy4zs7GXQge+Rksgbbt4FRbeNj7hjnCRJpKg2+x+nNZ3WmjtoVu8yvmhwYhQFOm7mto7SzA/dEseQgGvgqHMu1SU2HjSoQZJaq9tDo0/lVHHSkFLtclqBGoaTCxX+nbbqAa5y6TLJQsHea1rVeNrsi16lMk=\"}"

    var sInit = false
    private var sStart = false
    private var listener: OnAdInitListener? = null


    fun get(): TTAdManager? {
        return TTAdSdk.getAdManager()
    }

    fun init(context: Context, listener: OnAdInitListener? = null) {
        this.listener = listener
        //初始化穿山甲SDK
        doInit(context)
    }

    //step1:接入网盟广告sdk的初始化操作，详情见接入文档和穿山甲平台说明
    private fun doInit(context: Context) {
        if (sInit) {
            Log.i(TAG, "您已经初始化过了")
            return
        }

        //TTAdSdk.init(context, buildConfig(context));
        //setp1.1：初始化SDK
        sInit = TTAdSdk.init(context, buildConfig(context))
        Log.i(TAG, if (sInit) "初始化成功" else "初始化失败！")
    }

    fun start(context: Context?) {
        if (!sInit) {
            Log.i(TAG, "还没初始化SDK，请先进行初始化")
            return
        }
        if (sStart) {
            listener?.onInitSuccess()
//            startActivity(context);
            return
        }

        //setp1.2：启动SDK
        TTAdSdk.start(object : TTAdSdk.Callback {
            override fun success() {
                listener?.onInitSuccess()
                Log.i(TAG, "success: " + TTAdSdk.isSdkReady())
                //startActivity(context);
            }

            override fun fail(code: Int, msg: String?) {
                sStart = false
                listener?.onInitFailed()
                Log.i(TAG, "fail:  code = " + code + " msg = " + msg)
            }
        })
        sStart = true
    }

    fun startActivity(context: Context) {
//        val intent = Intent(context, MainActivity::class.java)
//        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
//        context.startActivity(intent)
//        (context as Activity).finish()
    }

    private fun buildConfig(context: Context?): TTAdConfig? {
        var configJsonObj: JSONObject? = null
        try {
            configJsonObj = JSONObject(localSettings)
        } catch (e: JSONException) {
        }
        return TTAdConfig.Builder()
            /**
             * 注：需要替换成在媒体平台申请的appID ，切勿直接复制
             */
            .appId(appViewModel.launchData.value?.adAppId) //5001121
            .appName(context?.getString(R.string.app_name))
            .debug(BuildConfig.DEBUG)
            /**
             * 使用聚合功能此开关必须设置为true，默认为false
             */
            .useMediation(true)
            .customController(tTCustomController) //如果您需要设置隐私策略请参考该api
            //                .setMediationConfig(new MediationConfig.Builder() //可设置聚合特有参数详细设置请参考该api
            //                        .setMediationConfigUserInfoForSegment(getUserInfoForSegment())//如果您需要配置流量分组信息请参考该api
            //                        .build())
            .setMediationConfig(
                MediationConfig.Builder()
                    .setCustomLocalConfig(configJsonObj)
                    .build()
            )
            .build()
    }

    private val userInfoForSegment: MediationConfigUserInfoForSegment
        get() {
            val userInfo = MediationConfigUserInfoForSegment()
            userInfo.setUserId("msdk-demo")
            userInfo.setGender(MediationConfigUserInfoForSegment.GENDER_MALE)
            userInfo.setChannel("msdk-channel")
            userInfo.setSubChannel("msdk-sub-channel")
            userInfo.setAge(999)
            userInfo.setUserValueGroup("msdk-demo-user-value-group")

            val customInfos: MutableMap<String?, String?> =
                HashMap<String?, String?>()
            customInfos.put("aaaa", "test111")
            customInfos.put("bbbb", "test222")
            userInfo.setCustomInfos(customInfos)
            return userInfo
        }

    private val tTCustomController: TTCustomController
        get() = object : TTCustomController() {
            override fun isCanUseWifiState(): Boolean {
                return super.isCanUseWifiState()
            }

            override fun getMacAddress(): String? {
                return super.getMacAddress()
            }

            override fun isCanUseWriteExternal(): Boolean {
                return super.isCanUseWriteExternal()
            }

            override fun getDevOaid(): String? {
                return SPUtils.getDevOaid()
            }

            override fun isCanUseAndroidId(): Boolean {
                return super.isCanUseAndroidId()
            }

            override fun getAndroidId(): String? {
                return super.getAndroidId()
            }

            override fun getMediationPrivacyConfig(): MediationPrivacyConfig? {
                return object : MediationPrivacyConfig() {
                    override fun isLimitPersonalAds(): Boolean {
                        return super.isLimitPersonalAds()
                    }

                    override fun isProgrammaticRecommend(): Boolean {
                        return super.isProgrammaticRecommend()
                    }
                }
            }

            override fun isCanUsePermissionRecordAudio(): Boolean {
                return super.isCanUsePermissionRecordAudio()
            }
        }

    interface OnAdInitListener {
        fun onInitSuccess()

        fun onInitFailed()
    }
}
